ggplotly(nationwide_cancer %>%
filter(sex != "All",
health_board == "scotland_wide",
cancer_site == "All cancer types") %>%
ggplot()+
aes(x = year, y = crude_rate, colour = sex)+
labs(x = "Year", y = "Crude rate", title = "Cancer incidence between men and women")+
geom_line())
ggplotly(nationwide_cancer %>%
filter(sex == "All",
cancer_site == "All cancer types") %>%
ggplot()+
aes(x = year, y = crude_rate, colour = health_board)+
labs(x = "Year", y = "Crude rate", title = "Crude rate of all cancer types per health board")+
geom_line()+
theme_minimal())
ggplotly(nationwide_cancer %>%
filter(sex == "All",
cancer_site != "All cancer types",
health_board == "scotland_wide") %>%
group_by(year) %>%
slice_max(crude_rate, n = 3) %>%
ggplot()+
aes(x = year, y = crude_rate, fill = cancer_site)+
theme(legend.position = "none")+
labs(x = "Year", y = "Crude rate", title = "Top 5 highest incidences of cancer")+
geom_col())
ggplotly(nationwide_cancer %>%
filter(sex %in% "All",
cancer_site == "All cancer types",
health_board %in% c("scotland_wide", "NHS Borders")) %>%
ggplot() +
aes(x = year, y = crude_rate, colour = health_board) +
geom_line(size = 1L) +
geom_smooth(span = 0.75)+
labs(x = "Year", y = "Crude rate", title = "Cancer incidence in the Borders compared to Scotland wide")+
scale_color_hue() +
theme_minimal())
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
### The top 5 highest incidences of cancer per health board over the years (1994 - 2018)
nationwide_cancer %>%
filter(cancer_site == "All cancer types",
sex == "All") %>%
group_by(year) %>%
slice_max(crude_rate, n = 5) %>%
select(year, health_board, crude_rate)
## # A tibble: 125 x 3
## # Groups: year [25]
## year health_board crude_rate
## <dbl> <chr> <dbl>
## 1 1994 NHS Western Isles 577.
## 2 1994 NHS Greater Glasgow and Clyde 548.
## 3 1994 NHS Dumfries and Galloway 539.
## 4 1994 NHS Highland 525.
## 5 1994 NHS Fife 518.
## 6 1995 NHS Dumfries and Galloway 559.
## 7 1995 NHS Borders 554.
## 8 1995 NHS Greater Glasgow and Clyde 549.
## 9 1995 NHS Tayside 532.
## 10 1995 NHS Lothian 517.
## # … with 115 more rows
nationwide_cancer %>%
filter(cancer_site == "All cancer types",
sex == "All") %>%
group_by(year) %>%
slice_max(crude_rate, n = 5) %>%
ggplot()+
aes(x = year, y = crude_rate, fill = (health_board == "NHS Borders"))+
scale_fill_discrete(name = " ", labels = c("Other health boards", "NHS Borders"))+
labs(x = "Year", y = "Crude rate", title = "Top 5 Health Boards with Highest Incidence of Cancer in Scotland")+
geom_col()
# Cancer data in the Borders
ggplotly(borders %>%
filter(sex %in% "All",
cancer_site != "All cancer types") %>%
ggplot() +
aes(x = year, y = crude_rate, colour = cancer_site) +
geom_line(size = 1L) +
scale_color_hue() +
labs(x = "Year", y = "Crude rate", title = "Cancer incidence in the Borders", fill = "Type of cancer")+
theme(legend.position = "none"))
ggplotly(borders %>%
filter(sex != "All",
cancer_site != "All cancer types") %>%
group_by(year, sex) %>%
slice_max(crude_rate, n = 3) %>%
ggplot()+
aes(x = year, y = crude_rate, colour = cancer_site)+
facet_wrap(~ sex)+
theme(legend.position = "none")+
labs(x = "Year", y = "Crude rate", title = "Top 3 highest incidences of cancer for men and women over the years")+
geom_line())